<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('审批用车')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-fCarUse-edit" th:object="${fCarUse}">
            <input name="useId" th:field="*{useId}" type="hidden">

            <div class="form-group">    
                <label class="col-sm-3 control-label">出发时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input readonly name="startTime" th:value="${#dates.format(fCarUse.startTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">归行时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input readonly name="endTime" th:value="${#dates.format(fCarUse.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">出发地：</label>
                <div class="col-sm-8">
                    <input readonly name="startLocation" th:field="*{startLocation}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">目的地：</label>
                <div class="col-sm-8">
                    <input readonly name="endLocation" th:field="*{endLocation}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">使用人：</label>
                <div class="col-sm-8">
                    <input readonly name="carUser" th:field="*{carUser}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">事由：</label>
                <div class="col-sm-8">
                    <textarea readonly name="reason" class="form-control">[[*{reason}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea readonly name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">审批状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('f_shenpi')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="examineStatus" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">审批意见：</label>
                <div class="col-sm-8">
                    <textarea name="examineRemark" class="form-control">[[*{examineRemark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "financial/fCarUse";
        $("#form-fCarUse-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/examineSave", $('#form-fCarUse-edit').serialize());
            }
        }

        // $("input[name='startTime']").datetimepicker({
        //     format: "yyyy-mm-dd",
        //     minView: "month",
        //     autoclose: true
        // });
        //
        // $("input[name='endTime']").datetimepicker({
        //     format: "yyyy-mm-dd",
        //     minView: "month",
        //     autoclose: true
        // });
    </script>
</body>
</html>